#pragma once
#include <iostream>
#include <string>

// 基类：交通工具
class Vehicle
{
public:
    virtual ~Vehicle() = default;
    virtual void Drive() const
    {
        std::cout << "交通工具正在行驶。" << std::endl;
    }
};

// 子类：汽车
class Car : public Vehicle
{
public:
    void Drive() const override
    {
        std::cout << "汽车正在行驶。" << std::endl;
    }
};

// 子类：自行车
class Bicycle : public Vehicle
{
public:
    void Drive() const override
    {
        std::cout << "自行车正在行驶。" << std::endl;
    }
};

// 测试函数，接受基类指针
inline void TestDrive(const Vehicle* vehicle)
{
    vehicle->Drive();
}